﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <Header>
    <Title>DevExpress MVC GridView</Title>
    <Author>Žeks</Author>
    <Shortcut>dxgv</Shortcut>
    <Description></Description>
    <SnippetTypes>
      <SnippetType>Expansion</SnippetType>
    </SnippetTypes>
  </Header>
  <Snippet>
    <Declarations>
      <Literal>
        <ID>name</ID>
        <Default>Name</Default>
      </Literal>
      <Literal>
        <ID>width</ID>
        <Default>300</Default>
      </Literal>
      <Literal>
        <ID>keyFieldName</ID>
        <Default>Id</Default>
      </Literal>
      <Literal>
        <ID>caption</ID>
        <Default></Default>
      </Literal>
      <Literal>
        <ID>controller</ID>
        <Default></Default>
      </Literal>
      <Literal>
        <ID>action</ID>
        <Default></Default>
      </Literal>
      <Literal>
        <ID>allowClientEventsOnLoad</ID>
        <Default>true</Default>
      </Literal>
      <Literal>
        <ID>pageSize</ID>
        <Default>25</Default>
      </Literal>
    </Declarations>
    <Code Language="HTML">
      <![CDATA[
@Html.DevExpress().GridView(s =>
{
    s.Name = "$name$";
    s.Caption = "$caption$";
    s.CallbackRouteValues = new {Controller = "$controller$", Action = "$action$"};
    //s.Columns.Add(c => { });
    //s.Columns.Add("", "").Width = Unit.Pixel();
    //s.SettingsBehavior.AllowGroup = true;
    //s.Settings.ShowGroupPanel = true;
    s.SettingsPager.PageSize = $pageSize$;
    s.Width = Unit.Pixel($width$);
    //s.SettingsBehavior.AllowFocusedRow = true;
    //s.Settings.ShowFilterRow = true;
    s.KeyFieldName = "$keyFieldName$";
    //s.ClientSideEvents.FocusedRowChanged = "";
    s.SettingsBehavior.AllowClientEventsOnLoad = $allowClientEventsOnLoad$;
}).Bind(Model).GetHtml()
      ]]>
    </Code>
  </Snippet>
</CodeSnippet>